package com.das.mechanic_base.widget;

import android.content.Context;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.das.mechanic_base.R;
import com.das.mechanic_base.base.X3BaseBottomSheetDialog;
import com.umeng.analytics.MobclickAgent;

public class X3HomeNoticePop extends X3BaseBottomSheetDialog {


    private TextView tv_affirm;
    private TextView tv_content;
    private TextView tv_title;

    private String title,content;
    private int type;

    public X3HomeNoticePop(@NonNull Context context, String title, String des) {
        super(context, R.style.dialog);
        this.title = title;
        this.content = des;
    }

    @Override
    protected boolean getDialogCancel() {
        return false;
    }

    @Override
    protected void initView() {
        tv_affirm = findViewById(R.id.tv_affirm);
        tv_content = findViewById(R.id.tv_content);
        tv_title = findViewById(R.id.tv_title);

        tv_title.setText(title);
        tv_content.setText(content);

        tv_affirm.setOnClickListener(view -> dismiss());
    }

    @Override
    protected int getLayoutId() {
        return R.layout.x3_home_notice_pop;
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    public void dismiss() {
        super.dismiss();
        MobclickAgent.onPageStart(type == 0? "检测单功能提示弹窗" : "施工单功能提示弹窗");
    }

    public void fromType(int type){
        this.type = type;
        MobclickAgent.onPageStart(type == 0? "检测单功能提示弹窗" : "施工单功能提示弹窗");
    }
}
